﻿// HSS.IO.Zip.ZipExceptions.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       ZipExceptions.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.IO.Zip
{
	#region Using Directives
	using System;

	#endregion

	#region BadPasswordException
	/// <summary>
	/// Issued when an <c>ZipEntry.ExtractWithPassword()</c> method is invoked
	/// with an incorrect password.
	/// </summary>
	[Serializable]
	public class BadPasswordException : ZipException
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public BadPasswordException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public BadPasswordException(String message)
			: base(message)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public BadPasswordException(String message, Exception innerException)
			: base(message, innerException)
		{
		}

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected BadPasswordException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }
	}
	#endregion

	#region BadReadException
	/// <summary>
	/// Indicates that a read was attempted on a stream, and bad or incomplete data was
	/// received.  
	/// </summary>
	[Serializable]
	public class BadReadException : ZipException
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public BadReadException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public BadReadException(String message)
			: base(message)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public BadReadException(String message,
			Exception innerException)
			: base(message, innerException)
		{
		}
		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected BadReadException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }

	}
	#endregion

	#region BadCrcException
	/// <summary>
	/// Issued when an CRC check fails upon extracting an entry from a zip archive.
	/// </summary>
	[Serializable]
	public class BadCRCException : ZipException
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public BadCRCException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public BadCRCException(String message)
			: base(message)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public BadCRCException(String message,
			Exception innerException)
			: base(message, innerException)
		{
		}
		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected BadCRCException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }

	}
	#endregion

	#region SfxGenerationException
	/// <summary>
	/// Issued when errors occur saving a self-extracting archive.
	/// </summary>
	[Serializable]
	public class SfxGenerationException : ZipException
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public SfxGenerationException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public SfxGenerationException(String message)
			: base(message)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public SfxGenerationException(String message, Exception innerException)
			: base(message, innerException)
		{ }


		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected SfxGenerationException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }

	}
	#endregion

	#region BadStateException
	/// <summary>
	/// Indicates that an operation was attempted on a ZipFile which was not possible
	/// given the state of the instance. For example, if you call <c>Save()</c> on a ZipFile 
	/// which has no filename set, you can get this exception. 
	/// </summary>
	[Serializable]
	public class BadStateException : ZipException
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public BadStateException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public BadStateException(String message)
			: base(message)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public BadStateException(String message,
			Exception innerException)
			: base(message, innerException)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected BadStateException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }

	}
	#endregion

	#region ZipException
	/// <summary>
	/// Base class for all exceptions defined by and throw by the Zip library.
	/// </summary>
	[Serializable]
	public class ZipException : Exception
	{
		/// <summary>
		/// Default ctor.
		/// </summary>
		public ZipException() { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		public ZipException(String message) : base(message) { }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="message">The message in the exception.</param>
		/// <param name="innerException">The innerException for this exception.</param>
		public ZipException(String message,
			Exception innerException)
			: base(message, innerException)
		{ }

		/// <summary>
		/// Come on, you know how exceptions work. Why are you looking at this documentation?
		/// </summary>
		/// <param name="serializationInfo">The serialization info for the exception.</param>
		/// <param name="streamingContext">The streaming context from which to deserialize.</param>
		protected ZipException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
			: base(serializationInfo, streamingContext)
		{ }

	}
	#endregion
}